#include <QApplication>
#include <QTimer>
#include <QList>
#include "crystalmem-include.h"

class Sidra {
public:
    Sidra() { qWarning("Sidra"); }
    ~Sidra() { qWarning("~Sidra"); }
};

int main(int argc, char ** args ) {
//    QCoreApplication app( argc, args );

    CRYSTALMEM_PROBE(

        // allocate a simple object
        qWarning( "creo array");
        int * s = new int[10];

        // allocate a complex object
        qWarning( "creo timer");
        QTimer * timer = new QTimer();
        qWarning( "avvio timer");
        timer->start( 100 );

        // destroy the simple object
        qWarning( "distruggo array");
        delete[] s;

        Sidra * si = new Sidra();
        delete si;


        QList<Sidra *> sidraList;
        for ( int i = 0; i < 1000000; i++)
            sidraList.append( si );
        sidraList.clear();
	
	char * a = new char[100000];
	
	QApplication app( argc, args );

        // destroy the complex object
        qWarning( "distruggo timer");
    )

    return 1;
}

